<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>我的会员_个人中心 - 胎大王</title>
	{include file='common/head' /}
</head>
<body>
<div class="container">
{include file='common/top' /}	
	<div class="usercenter">
		<div class="contai"><span class="f-bk30"></span>
			<div class="pure-g">
				{include file='common/usermenu' /}
				<div class="pure-u-1-24">&nbsp;</div>
				<div class="pure-u-18-24 right">
					<div class="con">
						<div class="f-bk30"></div>
						
						<form class="pure-form pure-form-aligned">
						    <fieldset>
						    	<legend>个人资料</legend>
						    	<div class="f-bk30"></div>
						        <div class="pure-control-group">
						            <label for="company">公司：</label>
						            <input  class="pure-input-2-3" id="company" type="text" disabled value="{$data.company}" />
						        </div>	
						        <div class="pure-control-group">
						            <label for="username">账号：</label>
						            <input  class="pure-input-2-3" id="username" type="text" disabled value="{$data.phone}" />
						        </div>	
						        <div class="pure-control-group">
						            <label for="name">联系人：</label>
						            <input  class="pure-input-2-3" id="name" type="text" disabled value="{$data.name}" />
						        </div>									
						        <div class="pure-control-group">
						            <label for="phone">手机号：</label>
						            <input  class="pure-input-2-3" id="phone" type="text" disabled value="{$data.phone}" />
						        </div>
						        <div class="pure-control-group">
						            <label for="password">*修改密码</label>
						            <input class="pure-input-2-3" id="password" type="password" placeholder="输入密码" />
						        </div>

						        <div class="pure-control-group">
						            <label for="repassword">*确认密码</label>
						            <input class="pure-input-2-3" id="repassword" type="password" placeholder="重新输入密码" />
						        </div>
						        <div class="pure-controls">
						            <button type="button" class="sub pure-button pure-button-primary">保存</button>
						        </div>
						    </fieldset>
						</form>
						<div class="f-bk30"></div>
					</div>

				</div>
			</div>
		</div>
		<span class="f-bk30"></span>
	</div>
	{include file='common/foot' /}	
</div>
<script src="__JS__/layer/layer.js"></script>
<script>
$(function(){

	$('.sub').click(function(){ 
		$(".sub").attr({"disabled":"disabled"});
		var password = $("#password").val();
		var repassword = $("#repassword").val();
		if(password.length<8){
			layer.alert("密码长度不足8位");
			$(".sub").removeAttr("disabled");
			return false;
		}
		if(password!=repassword){
			layer.alert("两次密码不一致");
			$(".sub").removeAttr("disabled");
			return false;
		}
		$.ajax({
			url: "/Member/pwdEdit.html",
			type: "POST",
			data: {password:password},
			dataType: "json",
			cache: false,
			success: function(data) {
				if(data.code==1){
					layer.alert("修改成功",function(){
						window.location.href='/member.html';							
					});					
				}else{
					layer.alert(data.msg);
					$(".sub").removeAttr("disabled");
				}
			}
		});		
	});		
});
</script>
</body>
</html>